package com.galen.manual.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false)
@TableName("tasks")
public class Task {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField("task_number")
    private String taskNumber; // 任务编号

    @TableField("user_id")
    private Long userId;

    @TableField("product_id")
    private Long productId;

    @TableField("product_name")
    private String productName; // 冗余字段，方便查询

    @TableField("unit_price")
    private BigDecimal unitPrice; // 冗余字段，防止价格变动影响结算

    @TableField("claimed_quantity")
    private Integer claimedQuantity; // 领取数量

    @TableField("completed_quantity")
    private Integer completedQuantity; // 完成数量

    @TableField("uncompleted_quantity")
    private Integer uncompletedQuantity; // 未完成数量

    @TableField("remaining_materials")
    private String remainingMaterials; // 剩余配件说明

    @TableField("completion_images")
    private String completionImages; // 完成图片URLs

    @TableField("remark")
    private String remark; // 备注

    @TableField("status")
    private Integer status; // 1:已领取 2:待审核 3:已完成 4:已驳回 5:已回收

    @TableField("claimed_time")
    private LocalDateTime claimedTime; // 领取时间

    @TableField("submitted_time")
    private LocalDateTime submittedTime; // 提交时间

    @TableField("reviewed_time")
    private LocalDateTime reviewedTime; // 审核时间

    @TableField("reviewed_by")
    private Long reviewedBy; // 审核人

    @TableField("review_comment")
    private String reviewComment; // 审核意见

    @TableField("reclaimed_time")
    private LocalDateTime reclaimedTime; // 回收时间

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableLogic
    @TableField("deleted")
    private Integer deleted;

}